const { VITE_HIDE_HOME } = import.meta.env;
const Layout = () => import("@/layout/index.vue");

export default [
  {
    path: "/",
    name: "Home",
    component: Layout,
    redirect: "/welcome",
    meta: {
      icon: "ep:home-filled",
      title: "首页",
      rank: 0
    },
    children: [
      {
        path: "/welcome",
        name: "Welcome",
        component: () => import("@/views/welcome/index.vue"),
        meta: {
          title: "首页",
          showLink: VITE_HIDE_HOME === "true" ? false : true
        }
      }
    ]
  },
  //系统设置 sys
  {
    path: "/sys",
    name: "Sys",
    component: Layout,
    redirect: "/sys/menu/index",
    meta: {
      icon: "ep:setting",
      title: "系统设置",
      rank: 1
    },
    children: [
      {
        path: "/sys/menu/index",
        name: "Menu",
        component: () => import("@/views/sys/menu/index.vue"),
        meta: {
          title: "菜单管理",
          showLink: true
        }
      },
      {
        path: "/sys/menu1/index",
        name: "Menu1",
        component: () => import("@/views/sys/menu1/index.vue"),
        meta: {
          title: "小程序菜单",
          showLink: true
        }
      },
      {
        path: "/sys/roles",
        name: "roles",
        component: () => import("@/views/sys/roles.vue"),
        meta: {
          title: "角色管理",
          showLink: true
        }
      },
      {
        path: "/sys/banner",
        name: "Banner",
        component: () => import("@/views/sys/banner.vue"),
        meta: {
          title: "轮播图",
          showLink: true
        }
      },
      {
        path: "/sys/xy",
        name: "sysxy",
        component: () => import("@/views/sys/xy.vue"),
        meta: {
          title: "协议管理",
          showLink: true
        }
      },
      {
        path: "/sys/limits",
        name: "sys/limits",
        component: () => import("@/views/sys/limits.vue"),
        meta: {
          title: "配置管理"
        }
      },
      {
        path: "/logs/login",
        name: "logslogin",
        component: () => import("@/views/logs/login.vue"),
        meta: {
          title: "登陆日志"
        }
      },
      {
        path: "/logs/operation",
        name: "logsoperation",
        component: () => import("@/views/logs/operation.vue"),
        meta: {
          title: "操作日志"
        }
      },
      {
        path: "/sys/exports",
        name: "sysExports",
        component: () => import("@/views/sys/exports.vue"),
        meta: {
          title: "导出管理"
        }
      }
    ]
  },
  {
    path: "/coupons",
    name: "coupons",
    component: Layout,
    redirect: "/coupons",
    meta: {
      icon: "ep:coin",
      title: "营销管理",
      rank: 0
    },
    children: [
      {
        path: "/coupons",
        name: "coupons",
        component: () => import("@/views/coupons.vue"),
        meta: {
          title: "优惠券"
        }
      },

      {
        path: "/voucher",
        name: "voucher",
        component: () => import("@/views/voucher.vue"),
        meta: {
          title: "运费券"
        }
      }
    ]
  },

  {
    path: "/users",
    name: "Users",
    component: Layout,
    redirect: "/users/list",
    meta: {
      icon: "ep:user",
      title: "用户管理",
      rank: 1
    },
    children: [
      {
        path: "/users/list",
        name: "UsersList",
        component: () => import("@/views/users/list.vue"),
        meta: {
          title: "用户列表"
        }
      },
      {
        path: "/users/staff",
        name: "UserStaff",
        component: () => import("@/views/users/staff.vue"),
        meta: {
          title: "员工列表"
        }
      }
    ]
  },
  {
    path: "/stores",
    name: "stores",
    component: Layout,
    redirect: "/goods/stores",
    meta: {
      icon: "ep:user",
      title: "门店管理",
      rank: 1
    },
    children: [
      {
        path: "/goods/stores",
        name: "stores",
        component: () => import("@/views/goods/store.vue"),
        meta: {
          title: "门店列表"
        }
      },
      {
        path: "/stores/goods",
        name: "storesGoods",
        component: () => import("@/views/stores/goods.vue"),
        meta: {
          title: "库存管理"
        }
      }
    ]
  },
  //订单管理 orders
  {
    path: "/order",
    name: "Order",
    component: Layout,
    redirect: "/order/list",
    meta: {
      icon: "ep:credit-card",
      title: "订单管理",
      rank: 2
    },
    children: [
      {
        path: "/order/list",
        name: "OrderList",
        component: () => import("@/views/order/list.vue"),
        meta: {
          title: "订单列表"
        }
      },
      {
        path: "/order/refund",
        name: "OrderRefund",
        component: () => import("@/views/order/refund.vue"),
        meta: {
          title: "退款审核"
        }
      }
    ]
  },

  //商品管理 goods
  {
    path: "/goods",
    name: "Goods",
    component: Layout,
    redirect: "/goods/list",
    meta: {
      icon: "ep:goods",
      title: "商品管理",
      rank: 2
    },
    children: [
      {
        path: "/goods/list",
        name: "GoodsList",
        component: () => import("@/views/goods/list.vue"),
        meta: {
          title: "商品列表"
        }
      },
      //商品分类
      {
        path: "/goods/cats",
        name: "GoodsCategory",
        component: () => import("@/views/goods/cats.vue"),
        meta: {
          title: "商品分类"
        }
      },
      //品牌 brands
      // {
      //   path: "/goods/brands",
      //   name: "GoodsBrands",
      //   component: () => import("@/views/goods/brands.vue"),
      //   meta: {
      //     title: "品牌管理"
      //   }
      // },
      //标签分组 labels
      {
        path: "/goods/labels",
        name: "GoodsLabels",
        component: () => import("@/views/goods/labels.vue"),
        meta: {
          title: "标签分组"
        }
      }
      // {
      //   path: "/goods/labelM",
      //   name: "GoodslabelM",
      //   component: () => import("@/views/goods/labelM.vue"),
      //   meta: {
      //     title: "标签成员"
      //   }
      // }
    ]
  }
  // {
  //   path: "/logs",
  //   name: "logs",
  //   component: Layout,
  //   redirect: "/logs/login",
  //   meta: {
  //     icon: "ep:loading",
  //     title: "日志管理",
  //     rank: 0
  //   },
  //   children: [

  //   ]
  // }
] satisfies Array<RouteConfigsTable>;
